#app {

  .main-container {
    height: 100%;
    transition: margin-left .28s;
    margin-left: $base-sidebar-width;
    position: relative;
  }

  .sidebarHide {
    margin-left: 0 !important;
  }


  .sidebar-container {
    -webkit-transition: width .28s;
    transition: width 0.28s;
    width: $base-sidebar-width !important;
    background-color: $base-menu-background;
    height: 100%;
    position: fixed;
    font-size: 0px;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1001;
    overflow: hidden;
    -webkit-box-shadow: 2px 0 6px rgba(0, 21, 41, .35);
    box-shadow: 2px 0 6px rgba(0, 21, 41, .35);




    // reset element-ui css
    .horizontal-collapse-transition {
      transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
    }

    .scrollbar-wrapper {
      overflow-x: hidden !important;
    }

    .el-scrollbar__bar.is-vertical {
      right: 0px;
    }

    .el-scrollbar {
      height: 100%;
    }

    &.has-logo {
      .el-scrollbar {
        height: calc(100% - 50px);
      }
    }

    .is-horizontal {
      display: none;
    }

    a {
      display: inline-block;
      width: 100%;
      overflow: hidden;
    }

    .svg-icon {
      margin-right: 16px;
    }

    .el-menu {
      border: none;
      height: 100%;
      width: 100% !important;
    }

    .el-menu-item, .menu-title {
      overflow: hidden !important;
      text-overflow: ellipsis !important;
      white-space: nowrap !important;
    }

    .el-menu-item .el-menu-tooltip__trigger {
      display: inline-block !important;
    }

    // menu hover
    .sub-menu-title-noDropdown,
    .el-sub-menu__title {
      &:hover {
        background-color: rgba(0, 0, 0, 0.06) !important;
      }
    }

    & .theme-dark .is-active > .el-sub-menu__title {
      color: $base-menu-color-active !important;
    }

    & .nest-menu .el-sub-menu > .el-sub-menu__title,
    & .el-sub-menu .el-menu-item {
      min-width: $base-sidebar-width !important;

      &:hover {
        background-color: rgba(0, 0, 0, 0.06) !important;
      }
    }

    & .theme-dark .nest-menu .el-sub-menu > .el-sub-menu__title,
    & .theme-dark .el-sub-menu .el-menu-item {
      background-color: $base-sub-menu-background !important;

      &:hover {
        background-color: $base-sub-menu-hover !important;
      }
    }
  }

  .functional {
    height: 100vh;
    .sidebar-container {
      width: 140px !important;
      background: #0045c6 !important;

      .sidebar-scrollbar {
        position: relative;
        &:hover .menu-collapse{
          display: block;
        }
        .menu-collapse{
          display: none;
          position: absolute;
          width: 20px;
          height: 60px;
          right: 0;
          bottom: 10rem;
          background: #409eff;
          color: #fff;
          cursor: pointer;
          .collapse-item{
            text-align: center;
            display: inline-block;
            line-height: 22px;
            align-items: center;
            font-size: 14px;
            color: #fff;
          }
        }
        .sidebar-background {
          height: 40px;
          width: 100%;
          position: absolute;
          background: #4878d2;
          z-index: 1;
          transition: top 0.2s;
        }
      }

      .settings {
        position: fixed;
        bottom: 20px;
        left: 20px;
        width: 120px;
        height: 25px;
        line-height: 25px;
        display: flex;

        &:hover {
          cursor: pointer;
        }

        .settings-title {
          color: #fff;
          font-size: 16px;
          margin-left: 10px;
        }
      }


      .el-menu {
        .el-menu-item {
          padding-right: 0 !important;
          height: 40px !important;
          position: relative;
          z-index: 2;

          &:hover {
            background: none !important;
          }
        }

        .el-menu-item.is-active {
          //background: #4878d2;
          color: #fff;
          font-weight: bold;
          transition: font-weight 0.2s;
        }
      }

      .el-sub-menu {
        .el-sub-menu__title {
          height: 40px !important;
          width: 100%;
          padding-right: 0 !important;
          position: relative;
          z-index: 2;

          &:hover {
            background: none !important;
          }

          .el-sub-menu__icon-arrow {
            position: absolute;
            top: -9999px;
          }
        }

      }

      .el-sub-menu {
        .router-link-active {
          //background: #4878d2 !important;
          font-weight: bold;
          transition: font-weight 0.2s;

        }
      }
    }

    .main-container {
      margin-left: 140px;
      height: 100%;
      .el-menu.el-menu--collapse{
        display: none;
      }

      .el-menu-item {
        height: 40px;

        &:hover {
          background: none !important;
        }

        .menu-title:hover {
          color: #409eff !important;
        }
      }

      .el-menu-item.is-active {
        background: #f0f9ff !important;
        border-right: 2px solid #409eff;

        .menu-title {
          color: #409eff !important;
        }
      }

      .el-sub-menu__title {
        font-size: 14px;
        color: #000;

        &:hover {
          background: none !important;
          color: #409eff !important;
        }
      }

      .svg-icon {
        width: 16px;
        height: 16px;
        color: #000;
        margin-right: 6px;
      }

      .el-menu-item {
        .menu-title {
          color: #000;
          font-size: 14px;
        }
      }
    }
  }

  .dock{
    .sidebar-container{
      width: 65px !important;
    }
  }

  .hideSidebar {
    .sidebar-container {
      width: 54px !important;
    }

    .main-container {
      margin-left: 54px;
    }

    .sub-menu-title-noDropdown {
      padding: 0 !important;
      position: relative;

      .el-tooltip {
        padding: 0 !important;

        .svg-icon {
          margin-left: 20px;
        }
      }
    }

    .el-sub-menu {
      overflow: hidden;

      & > .el-sub-menu__title {
        padding: 0 !important;

        .svg-icon {
          margin-left: 20px;
        }

      }
    }

    .el-menu--collapse {
      .el-sub-menu {
        & > .el-sub-menu__title {
          & > span {
            height: 0;
            width: 0;
            overflow: hidden;
            visibility: hidden;
            display: inline-block;
          }

          & > i {
            height: 0;
            width: 0;
            overflow: hidden;
            visibility: hidden;
            display: inline-block;
          }
        }
      }
    }
  }

  .el-menu--collapse .el-menu .el-sub-menu {
    min-width: $base-sidebar-width !important;
  }

  // mobile responsive
  .mobile {
    .main-container {
      margin-left: 0px;
    }

    .sidebar-container {
      transition: transform .28s;
      width: $base-sidebar-width !important;
    }

    &.hideSidebar {
      .sidebar-container {
        pointer-events: none;
        transition-duration: 0.3s;
        transform: translate3d(-$base-sidebar-width, 0, 0);
      }
    }
  }

  .withoutAnimation {

    .main-container,
    .sidebar-container {
      transition: none;
    }
  }
}

// when menu collapsed
.el-menu--vertical {
  & > .el-menu {
    .svg-icon {
      margin-right: 16px;
    }
  }

  .nest-menu .el-sub-menu > .el-sub-menu__title,
  .el-menu-item {
    &:hover {
      // you can use $sub-menuHover
      background-color: rgba(0, 0, 0, 0.06) !important;
    }
  }

  // the scroll bar appears when the sub-menu is too long
  > .el-menu--popup {
    max-height: 100vh;
    overflow-y: auto;

    &::-webkit-scrollbar-track-piece {
      background: #d3dce6;
    }

    &::-webkit-scrollbar {
      width: 6px;
    }

    &::-webkit-scrollbar-thumb {
      background: #99a9bf;
      border-radius: 20px;
    }
  }
}
